 
package datolib;

public enum Platform {

	MOBILE("Mobile"), TABLET("Tablet"), DEFAULT("Default"), DESKTOP("Desktop"), NA("na");
	
	private final 	String text;
	
	
 	Platform(String txt) {
    	this.text = txt;
  	}
	
	public String toString() {
		return this.text;
	}
	
	public static Platform fromText(String plat) {
		if (plat.equals("desktop")) {
			return Platform.DESKTOP;
		} else if (plat.equals("tablet")) {
			return Platform.TABLET;
		} else if (plat.equals("mobile")) {
			return Platform.MOBILE;
		} else if (plat.equals("default")) {
			return Platform.DEFAULT;
		} else {
			return Platform.NA;
		}
	}
}


